Skip to main content

Creating topics from CSV or Excel files

With the Topic Creator tools you can create topics, snippets, or other XML files from a different data sources. This lets you maintain data in, for example, Excel, and then create the topics using a template file.

Set up a template file

You can set up a template in any valid XML-file, for example, topic files (.htm), snippet files (.flsnp), or even target files (.fltar).

Set up a template that creates one file per line

  1. Create a new file in Flare.

  2. Open the file in, e.g. Notepad++.

  3. Use the headers from your data file where you want to import the data. For example, if your Excel file has two columns, Title and Description - you could set up a template like this:

	<?xml version="1.0" encoding="utf-8"?>
<html>
<body>
<h1>[[Title]]</h1>
<p>[[Description]]</p>
</body>
</html>

Sample CSV data

Title;Description
Title A;Description A
Title B;Description B

Templates with repeating patterns

If your data is hierarchical, for example like this,

TitleData AData BData C
Lorem ALorem 1Lorem 2Lorem 3
Lorem ALorem 1.1Lorem 2.1Lorem 3.1
Lorem ALorem 1.2Lorem 2.2Lorem 3.2

, you can set up a template with a repeating pattern, where the headers inside the <div class="repeat" > are repeated while the other headers stay the same. The example would result in two files each containing a table.

	<?xml version="1.0" encoding="utf-8"?>
<html>
<body>
<h1><[[Title]]/h2>
<div class="repeat">
<table>
<th>
<td>Data A</td>
<td>Data B</td>
<td>Data C</td>
</th>
<tr>
<td>[[Data A]]</td>
<td>[[Data B]]</td>
<td>[[Data C]]</td>
</tr>
</table>
</div>
</body>
</html>

Import data from a CSV file

Note that the CSV file must have a header row.

  1. Click Data Import (CSV).
  2. Select the path to the CSV file.
  3. Select the path to the template file.
  4. Select the folder where you want the output files.
  5. To overwrite any existing files, select the Overwrite files checkbox.
  6. To generate the files, click Execute.

Sample CSV data

Title;Description Title A;Description A Title B;Description B

Import data from an Excel file

Note that the Excel file must have a header row.

  1. Click Data Import (Excel).
  2. Select the path to the Excel file.
  3. Select the path to the template file.
  4. Select the folder where you want the output files.
  5. To overwrite any existing files, select the Overwrite files checkbox.
  6. To generate the files, click Execute.